# 系统设置
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR 3516cv610)

# 工具链配置
set(TOOLCHAIN_ROOT ${PROJECT_SOURCE_DIR}/toolchains/3516cv610)
set(CMAKE_C_COMPILER   ${TOOLCHAIN_ROOT}/bin/arm-v01c02-linux-musleabi-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_ROOT}/bin/arm-v01c02-linux-musleabi-g++)
set(CMAKE_STRIP        ${TOOLCHAIN_ROOT}/bin/arm-v01c02-linux-musleabi-strip)

# 系统根目录设置
set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_ROOT}/arm-buildroot-linux-musleabi/sysroot)
set(CMAKE_SYSROOT ${TOOLCHAIN_ROOT}/arm-buildroot-linux-musleabi/sysroot)

# 查找路径模式设置
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# 包含目录设置
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/device/soc/hisilicon/3516cv610/include)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third_party/include)
include_directories(SYSTEM ${PROJECT_SOURCE_DIR}/third_party/include/eudev)

# 链接目录设置
link_directories(${PROJECT_SOURCE_DIR}/device/soc/hisilicon/3516cv610/lib)
link_directories(${PROJECT_SOURCE_DIR}/third_party/lib/3516cv610)

# 芯片相关库配置
set(EL_CHIP_LIBS
    # 基础库
    securec
    hi_mpi 
    hi_mpi_sysbind 
    hi_mpi_sysmem

    # ISP相关库
    hi_mpi_ae
    hi_mpi_isp
    ot_mpi_isp
    hi_mpi_awb
    dehaze
    extend_stats
    drc
    ldci
    bnr
    calcflicker
    ir_auto
    acs

    # 传感器库
    sns_sc4336p
    sns_gc4023
    sns_sc431hai
    sns_sc450ai
    sns_sc500ai
    sns_os04d10

    # SVP相关库
    svp_acl

    # VQE相关库
    vqe_res
    vqe_record 
    vqe_hpf
    vqe_anr
    vqe_aec
    vqe_agc
    vqe_eq
    vqe_talkv2

    # AAC相关库
    aac_dec
    aac_enc
    aac_comm
    aac_sbr_dec
    aac_sbr_enc
)
# 包含通用配置
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)

# 编译标志设置
set(CMAKE_COMMON_FLAGS "${CMAKE_COMMON_FLAGS} -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -Wno-psabi -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_COMMON_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_COMMON_FLAGS}")

# 系统标识
string(TOLOWER ${CMAKE_SYSTEM_NAME} CW_SYSTEM_NAME)
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} CW_SYSTEM_PROCESSOR)